package com.learn.my.serice.impl;

import com.learn.my.bean.User;
import com.learn.my.dao.UserDAO;
import com.learn.my.serice.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Slf4j
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDAO userDAO;


    @Override
    @Transactional
    public boolean insertNewUser(User user) {
        return  userDAO.insertSelective(user)==1;
    }

    @Override
    public User findUserInfo(Integer id) {
        return userDAO.selectByPrimaryKey(id);
    }
}
